The two most common types of video are interlaced video and non-interlaced or progressive video. In progressive video sequences, each frame of video data is a complete picture (e.g., 480 scan lines) and will usually be displayed all at one time. In interlaced video sequences, each frame of video data represents, alternatively, the odd lines of an image (e.g., 1, 3, . . . 479), or the even lines of an image (e.g., 2, 4, . . . 480). When interlaced video is displayed, odd lines are displayed, and then even lines are displayed, and so on. A frame of odd numbered lines is referred to as an odd field, and a frame of even numbered lines is referred to as an even field.
Interlaced video works well with an end-to-end analog system where an analog camera signal is transmitted in analog form and displayed by an analog television. However, modern displays and televisions may need to perform various digital processing operations such as image scaling. Furthermore, modern display technologies like LCD, DLP, LCOS, and plasma are natively progressive and thus interlaced video must be deinterlaced and converted into a progressive form in order to scale or perform other operations. Interlaced video can't be scaled without creating severe artifacts and so it must be deinterlaced first. In some cases such as with high resolution CRTs, in order to improve image quality interlaced video will be deinterlaced, scaled up, and then reinterlaced so it can be displayed as high resolution interlaced video, for example 1080i. All this requires deinterlacing.
FIG. 1 shows how a progressive source can be converted to and displayed as interlaced video. A progressive source 50 such as film, computer generated graphics, progressive-captured video, etc. is converted to video fields 52 using telecine (television-cinema) conversion, for example. Telecine conversion takes a single frame of the progressive source 50 and divides it into an odd field and an even field. An extra field may be inserted for every other source frame to increase the frame rate, e.g., from 24 frames-per-second (fps) film to 60 fps interlaced video. Referring to FIG. 1, frame A is converted to odd field A1 and even field A2. Field A1 is repeated. Frame B is converted to odd field B1 and even field B2, and so on. The effect is that each source frame is converted to 3 fields, then 2 fields, then 3 fields, etc., thus producing 10 fields (5 frames) for every 4 progressive/film input frames. This is often called 3-2 pulldown. The interlaced video fields 52 may be displayed as interlaced frames 54, for example on an interlaced display. In this case, odd field A1 is displayed on the odd lines of the display, then even field A2 is displayed on the even lines of the display, and so on.
As discussed in detail later, interlaced video frames 54 may also have flags 55 that may indicate properties of the frames 54 and/or the fields therein. For example, in the case of MPEG2, SMPTE VC1, and MPEG4 AVC (H.264), video, flags 55 may include: a repeat flag indicating whether a field is to be repeated; a progressive flag indicating whether the two fields in a frame go together to form a progressive picture (i.e., is from a progressive source); a top flag indicating whether the top (odd) field in a frame goes first; a “repeat first field” flag indicating to a decoder that after the first and second field of a frame are outputted the first field should be outputted again—if the “repeat first field” is not true then only the first field and second field are outputted; etc.
Other encoding schemes are somewhat similar in concept to 3-2 pulldown but may vary in cadence, frame rates, etc. For example, 2-2-2-4 and 2-3-3-2 are used for DV Cam. There is also 3-2-3-2-2 which is used for Varispeed to speed up presentation and squeeze an extra 30 second commercial into a 30 minute show. There are also 5-5, 8-8, 8-7 and 6-4 which are used for animated material such as Japanese anime. While 3-2, 2-2-2-4, 2-3-3-2, and 3-2-3-2-2 all cover 24 frame per second progressive content, 5-5 is for 12 frames per second. Sometimes 2-2 pulldown is used, which is 30 frames per second in the US and 25 frames per second in Europe. Embodiments in the Detailed Description can be tailored for any current or future type of encoding profile or scheme
FIG. 2 shows interlaced video 54 converted to progressive video 56. Often there is a need to convert interlaced video to progressive video by combining odd fields with corresponding even fields to produce a complete progressive image for display. For example, some displays are only capable of displaying progressive video. Furthermore, progressive video is often brighter and sharper than interlaced video and may also have fewer visible artifacts.
To avoid confusion of terminology, it should be noted that at least in the case of MPEG2, or SMPTE VC1, or MPEG4 AVC (H.264), the output of the decoding process, for interlaced sequences, comprises a series of reconstructed fields that are separated in time by a field period. The two fields of a frame may be coded separately as field pictures. Alternatively the two fields may be coded together as a frame, sometimes called a frame picture. Both frame pictures and field pictures may be used in a single video sequence.
How difficult it is to combine an odd field with an even field, and the quality of an image so produced, depends significantly on whether the odd field and even field are actually from a same single original progressive image or frame. If an odd field and an even field are from a same progressive source then they may be combined with a trivial weave or union operation. For example, in the case of a 480 line display image or area, an odd frame having lines 1, 3, . . . , 479 is combined with an even frame having lines 2, 4, . . . , 480, to produce a complete progressive frame with lines 1, 2, 3, 4 . . . 479, 480. Referring again to FIG. 2, field A1 and field A2 are combined to form progressive frame A, which may be repeated as needed to achieve an appropriate frame rate. Frames B, C, etc. may be similarly reconstituted and possibly repeated. This form of deinterlacing is sometimes called inverse telecine.
If the odd and even fields of interlaced video are not from the same image (i.e., the source is not progressive) then likely their image data was captured at different times (e.g., with an interlaced camera) and most likely cannot be merged as simply as in the case of fields of a progressive source image. In this case, so called video deinterlacing may be used. Video deinterlacing may involve a wide variety of simple to sophisticated image processing algorithms which in effect produce an interpolation, average, etc. of the odd and even field. Video deinterlacing using image processing is difficult because when some objects in a field are stationary and some are moving there is no perfect way to deinterlace; two fields of a same frame do not represent a single real world snapshot and cannot be combined perfectly. Most approaches generally involve interpolation to fill in missing information. Video deinterlacing inherently produces imperfect images.
In sum, interlaced video from a progressive source can and should be deinterlaced by weaving fields, and true interlaced video may if necessary be deinterlaced using imperfect video deinterlacing.
It is important to apply the appropriate form of deinterlacing for any given interlaced video sequence. If two fields are from a progressive source and form a natural progressive image then, as discussed above, it is easy and preferable to deinterlace them using simple weaving. Furthermore, if those progressive-source fields are mischaracterized as interlaced video and are subjected to video deinterlacing, then severe visual artifacts will result. Similarly, if two fields are truly interlaced and do not form a progressive frame then they should be deinterlaced using video deinterlacing. As discussed below with reference to FIG. 3, there are some imperfect techniques for identifying progressive-source video.
FIG. 3 shows a system 70 that deinterlaces video. System 70 could be a DVD player, a media application on a computer, a deinterlace device either coupleable inline before a display or television or incorporated in a display or television, etc., in the form of hardware or software or both. System 70 may receive interlaced video 72 that was encoded from a progressive source 74, or it may receive interlaced video 76 that is from an interlaced source 78. If system 70 is to produce deinterlaced video, as discussed above it is preferable to directly unite odd and even fields that are from a progressive image. Therefore, system 70 has a detector 80 to detect whether fields form a progressive frame. If the detector 80 detects a progressive frame then the fields are deinterlaced by a weaving-type deinterlacer 82. If the detector does not detect a progressive frame, then the fields are deinterlaced by a video deinterlacer 84.
The detector 80 may employ a number of well known techniques for detecting progressive fields (fields whose odd/even partner are from a same progressive source or image). However, these techniques sometimes fail to identify progressive fields and sometimes mistakenly identify non-progressive fields as progressive.
One such technique is flag analysis—analyzing the repeat-first field, top-field-first, and/or progressive-frame flags in a video stream. Flag analysis may work if the video has been correctly encoded. However, flags are often not set correctly and their values differ from the true nature of the video with which they are associated. For example, progressive frames may have their progressive flags set to false. Flags errors can result from human error during the encoding process. Many MPEG encoders introduce flag errors on chapter breaks because they insert chapter breaks after encoding and re-encode the areas around the chapter breaks, which causes errors. Errors can also occur in shows edited with systems that ignore the 3-2 pattern because they were designed to edit video. There are many scenarios where flags are not set correctly and the progressive nature of video cannot be detected by flag analysis. Furthermore, flag analysis usually requires access to the actual compressed stream, but a stand alone chip in a television, for example, may not have access to the compressed stream.
Another technique for identifying progressive video is cadence analysis. Cadence analysis involves comparing the image data of fields (e.g. with image analysis) to find fields that are effectively equal, and then looking at the cadence of equal fields (e.g. 323232) to spot telecine encoding of a progressive source. Referring to FIG. 1, a cadence analyzer might recognize that the first A1 field is equal to the third field/frame which is also A1. Cadence analysis avoids the problem of non-standard or missing flags but can fail when the cadence is irregular or unexpected, or when noise makes field matching unreliable.
In sum, it is difficult to use one technique to reliably determine, for many different interlaced video streams and sources, whether fields are from a progressive source and form a progressive frame or whether the fields are truly interlaced (i.e., their lines were not captured at the same time).